home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Found / FWCommon / Include / FWEnvDef.h < prev    next >
Encoding:
Text File  |  1995-11-08  |  7.1 KB  |  272 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWEnvDef.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Copyright:    (c) 1993, 1995 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWENVDEF_H
  11. #define FWENVDEF_H
  12.  
  13. //========================================================================================
  14. // Definitions Specific to the Build Configuration
  15. //========================================================================================
  16.  
  17. #ifndef FWBLDDEF_H
  18. #include "FWBldDef.h"
  19. #endif
  20.  
  21. //========================================================================================
  22. // Metrowerks -- Macintosh
  23. //========================================================================================
  24.  
  25. #ifdef __MWERKS__
  26.  
  27.     #define FW_BUILD_MAC
  28.     #undef FW_BUILD_WIN
  29.     #undef FW_BUILD_WIN16
  30.     #undef FW_BUILD_WIN32
  31.     #undef FW_BUILD_WIN32S
  32.     
  33.     #define ppcinterfaces 1
  34.     #define OLDROUTINENAMES         0
  35.     #define OLDROUTINELOCATIONS     0
  36.     // Portablility defines for export mechanisms used by MS Windows compilers
  37.     #define FW_CLASS_ATTR
  38.     #define FW_FUNC_ATTR
  39.     
  40.     #ifndef FW_LIB_EXPORT_PRAGMAS
  41.     #define FW_LIB_EXPORT_PRAGMAS 0
  42.     #endif
  43.     
  44.     // Hack to control what is exported from a CFM shared lib on PPC. Define functions
  45.     // with indicative names which CodeWarrior will place in the .exp file. The MPW tool
  46.     // MWExportTool will then filter the .exp removing exports between off functions and
  47.     // on functions, inclusive. The functions are dead-stripped since they are not exported
  48.     // and never referenced.
  49.     
  50.     #define FW_EXPORT_ON(file, id) \
  51.         extern "C" void _FW_export_lib_on_##file##id(); \
  52.         extern "C" void _FW_export_lib_on_##file##id() { }
  53.     #define FW_EXPORT_OFF(file, id) \
  54.         extern "C" void _FW_export_lib_off_##file##id(); \
  55.         extern "C" void _FW_export_lib_off_##file##id() { }
  56.     
  57.     // The runtime file that defines these also defines global new and delete. Here we supply
  58.     // our own version of these so that we don't have to depend on a modified version of the 
  59.     // CodeWarrior runtime library.
  60.     
  61. //    #define FW_OPERATOR_NEW_SIZE_T_VOIDSTAR
  62.     #define FW_SET_NEW_HANDLER
  63.     
  64.     #define FW_FOUR_BYTE_INTS __fourbyteints__
  65.  
  66.     // Force PowerPC alignment
  67.     #pragma options align=power
  68.  
  69. //========================================================================================
  70. // Symantec C++ -- Macintosh
  71. //========================================================================================
  72. #elif defined SYMANTEC_CPLUS && !defined _WINDOWS
  73.     
  74.     #pragma options(system_includes_from_project_tree)
  75.     
  76.     #define FW_AGGRESSIVE_PRECOMPILE 1
  77.  
  78.     #ifndef FW_LIB_EXPORT_PRAGMAS
  79.     #define FW_LIB_EXPORT_PRAGMAS 0
  80.     #endif
  81.     #define PRAGMA_LIB_EXPORT 1
  82.     #define PRAGMA_IMPORT 1
  83.     
  84.     #ifndef SOMLINK
  85.     #define SOMLINK
  86.     #endif
  87.     
  88.     #ifndef SOMDLINK
  89.     #define SOMDLINK
  90.     #endif
  91.     
  92.     #define FW_BUILD_MAC
  93.     #undef FW_BUILD_WIN
  94.     #undef FW_BUILD_WIN16
  95.     #undef FW_BUILD_WIN32
  96.     #undef FW_BUILD_WIN32S
  97.     
  98.     #define ppcinterfaces 1
  99.     #define OLDROUTINENAMES 0
  100.     #define OLDROUTINELOCATIONS     0
  101.     
  102.     // Portablility defines for export mechanisms used by MS Windows compilers
  103.     #define FW_CLASS_ATTR
  104.     #define FW_FUNC_ATTR
  105.     
  106.     #define FW_EXPORT_ON
  107.     #define FW_EXPORT_OFF
  108.     
  109.     #ifndef FW_FOUR_BYTE_INTS
  110.     #define FW_FOUR_BYTE_INTS __option(int_4)
  111.     #endif
  112.  
  113.     // Force PowerPC alignment
  114.     #pragma options align=power
  115.  
  116. //========================================================================================
  117. // CFM 68K using Symantec SCpp (__SC__ would also catch SPM but that's listed above)
  118. //========================================================================================
  119. #elif defined __SC__ && !defined _WINDOWS
  120.     
  121.     #define FW_AGGRESSIVE_PRECOMPILE 1
  122.  
  123.     #ifndef FW_LIB_EXPORT_PRAGMAS
  124.     #define FW_LIB_EXPORT_PRAGMAS 0
  125.     #endif
  126.     
  127.     #ifndef SOMLINK
  128.     #define SOMLINK
  129.     #endif
  130.     
  131.     #ifndef SOMDLINK
  132.     #define SOMDLINK
  133.     #endif
  134.     
  135.     #define FW_BUILD_MAC
  136.     #undef FW_BUILD_WIN
  137.     #undef FW_BUILD_WIN16
  138.     #undef FW_BUILD_WIN32
  139.     #undef FW_BUILD_WIN32S
  140.     
  141.     #define ppcinterfaces 1
  142.     #define OLDROUTINENAMES 0
  143.     #define OLDROUTINELOCATIONS     0
  144.     
  145.     // Portablility defines for export mechanisms used by MS Windows compilers
  146.     #define FW_CLASS_ATTR
  147.     #define FW_FUNC_ATTR
  148.     
  149.     #define FW_EXPORT_ON
  150.     #define FW_EXPORT_OFF
  151.     
  152.     #ifndef FW_FOUR_BYTE_INTS
  153.     #define FW_FOUR_BYTE_INTS __option(int_4)
  154.     #endif
  155.     
  156. //========================================================================================
  157. // Mr. C -- Macintosh
  158. //========================================================================================
  159. #elif defined __MRC__
  160.  
  161.     #ifndef FW_LIB_EXPORT_PRAGMAS
  162.     #define FW_LIB_EXPORT_PRAGMAS 0
  163.     #endif
  164.     
  165.     #define FW_BUILD_MAC
  166.     #undef FW_BUILD_WIN
  167.     #undef FW_BUILD_WIN16
  168.     #undef FW_BUILD_WIN32
  169.     #undef FW_BUILD_WIN32S
  170.     
  171.     #define ppcinterfaces 1
  172.     #define OLDROUTINENAMES         0
  173.     #define OLDROUTINELOCATIONS     0
  174.  
  175.     // Portablility defines for export mechanisms used by MS Windows compilers
  176.     #define FW_CLASS_ATTR
  177.     #define FW_FUNC_ATTR
  178.     
  179.     #define FW_EXPORT_ON
  180.     #define FW_EXPORT_OFF
  181.     
  182.     #define FW_FOUR_BYTE_INTS 1
  183.  
  184.     // Force PowerPC alignment
  185.     #pragma options align=power
  186.  
  187. //========================================================================================
  188. // Microsoft Visual C++ - Windows
  189. //========================================================================================
  190. #elif defined _MSC_VER
  191.  
  192.     #ifdef _WINDOWS_
  193.     #error Include FWEnvDef.h before including Windows.h
  194.     #endif
  195.  
  196.     #define FW_BUILD_WIN
  197.     #define FW_BUILD_WIN32
  198.     #define FW_HAS_INSTANCE_DATA
  199.     #define FW_NATIVE_EXCEPTIONS
  200.     #define FW_SET_NEW_HANDLER
  201.  
  202.     #define FW_LIB_EXPORT_PRAGMAS        0
  203.     #define FW_FOUR_BYTE_INTS            1
  204.  
  205.     #define STRICT
  206.  
  207.     #define PLATFORM_WINDOWS
  208.  
  209.     #include <windows.h>
  210.     
  211.     #pragma warning(disable:4080)        // Invalid name in segment pragma
  212.  
  213. //========================================================================================
  214. // Symantec C++ - Windows
  215. //========================================================================================
  216. #elif defined __SC__ && defined _WINDOWS
  217.  
  218.     #ifdef _WINDOWS_
  219.     #error Include FWEnvDef.h before including Windows.h
  220.     #endif
  221.  
  222.     #define FW_BUILD_WIN
  223.     #define FW_BUILD_WIN32
  224.     #define FW_HAS_INSTANCE_DATA
  225.     #define FW_NATIVE_EXCEPTIONS
  226.     #define FW_SET_NEW_HANDLER
  227.  
  228.     #define FW_LIB_EXPORT_PRAGMAS        0
  229.     #define FW_FOUR_BYTE_INTS            1
  230.     #define FW_AGGRESIVE_PRECOMPILE 1
  231.  
  232.     #define STRICT
  233.  
  234.     #define PLATFORM_WINDOWS
  235.  
  236.     #include <windows.h>
  237.     
  238.     #define SOMLINK __stdcall
  239.     #define SOMDLINK __stdcall
  240.  
  241. //========================================================================================
  242. // Unsupported Compiler
  243. //========================================================================================
  244. #else
  245.  
  246.     #error Unsupported compiler
  247.  
  248. #endif
  249.  
  250. //========================================================================================
  251. // Other Defines 
  252. //========================================================================================
  253. #ifdef FW_BUILD_MAC
  254.     #ifndef _PLATFORM_MACINTOSH_
  255.         #define _PLATFORM_MACINTOSH_         1
  256.     #endif
  257.     #ifndef PLATFORM_MACINTOSH
  258.         #define PLATFORM_MACINTOSH             1
  259.     #endif
  260.     #if !defined(FW_HAS_INSTANCE_DATA)
  261.         #define FW_HAS_INSTANCE_DATA
  262.     #endif
  263. #endif
  264.  
  265. #ifdef FW_BUILD_WIN
  266.     #ifndef PLATFORM_WINDOWS
  267.         #define PLATFORM_WINDOWS             1
  268.     #endif
  269. #endif
  270.  
  271. #endif
  272.